package com.itheima.d03_api_array_sort;

import java.util.Arrays;

/**
 * 目标：了解自定义数组排序的方式
 */
public class Test2 {

    public static void main(String[] args) {
        //1.准备测试学生数据
        Student[] students = {
            new Student("小王", 180, 18),
            new Student("小张", 170, 29),
            new Student("小李", 165, 17),
            new Student("小赵", 160, 21)
        };

        //2.Arrays工具类，进行排序，未知排序规则
        Arrays.sort(students);

        //3.打印排序结果
        for (int i = 0; i < students.length; i++) {
            System.out.println(students[i]);
        }
    }
}
